package com.architect.mvp.android;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;

import com.architect.mvp.android.mvp.LoginPresenter;
import com.architect.mvp.android.mvp.LoginView;

public class MainActivity extends AppCompatActivity implements LoginView {

    private LoginPresenter presenter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        this.presenter = new LoginPresenter();
        this.presenter.attachView(this);

        this.presenter.login("Dream","123456");
    }

    @Override
    public void onLoginResult(String result) {
        Log.i("main","服务器返回的结果:"+result);
    }


    @Override
    protected void onDestroy() {
        super.onDestroy();
        this.presenter.detachView();
    }
}
